<template>
  <div class="liveStream">
    <h1>直播课程</h1>
    <div class="left">

      <div v-for="(item,index) in titleList" :key="index" class="picture">
        <div v-show="index==index1">
          <div class="mb">
            <h1 style="color: #FFFFFF">{{ item.title }}</h1>
            <span><a-icon type="check-circle"/> 直播结束</span>
            <button>直播结束</button>
          </div>
          <img :src="item.imgList" alt="">
        </div>
      </div>
    </div>
    <div class="right">
      <ul>
        <li v-for="(item,index) in titleList" :key="index" @mouseenter="show(index)" ref="after">
          <div class="whitemb" v-show="index==index1">
            <a-icon type="check-circle"/>&nbsp;&nbsp;
            直播结束 &nbsp;&nbsp;{{ item.title }}
          </div>
            <a-icon type="check-circle"/>&nbsp;&nbsp;
            直播结束 &nbsp;&nbsp;{{ item.title }}

        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  name: "Livestream",
  data() {
    return {
      index1: 0,
      titleList: [
        {title: "求职技巧之重难点问题剖析与解决", imgList: "https://online-course.nos-eastchina1.126.net/封面-1258625253353979904.png"},
        {title: "IT开发方向之职业规划", imgList: "https://online-course.nos-eastchina1.126.net/直播封面-1254953535796150272.png"},
        {title: "研究生复试之高效准备简历的方法", imgList: "https://online-course.nos-eastchina1.126.net/123-1252130152859566080.png"},
        {
          title: "十大经典排序之part-6-完结篇",
          imgList: "https://online-course.nos-eastchina1.126.net/数据结构与算法 基础篇 拷贝-1252123020651134976.jpg"
        },
        {
          title: "jdk 1.8-新特性之函数式接口与方法引用",
          imgList: "https://online-course.nos-eastchina1.126.net/封面-1258625253353979904.png"
        }
      ]
    }
        ;
  },
  methods: {
    show(index) {
      this.index1 = index
      this.$refs.after[index].style.css="color:#00cf8c"
    }
  },
}
</script>

<style scoped lang="less">
.liveStream {
  width: 1200px;
  height: 420px;
  margin: 50px auto;

  h1 {
    font-size: 25px;
    font-weight: 500;
    margin: 20px auto;
  }

  .left {
    width: 50%;
    height: 350px;
    float: left;
    position: relative;

    .mb {
      width: 100%;
      height: 350px;
      position: absolute;
      left: 0;
      top: 0;
      background-color: rgba(0, 0, 0, .3);
      z-index: 10;
      color: #FFFFFF;

      h1 {
        font-size: 24px;
        opacity: 1;
        margin: 80px auto 20px;
      }

      span {
        display: block;
        text-align: center;
      }

      button {
        width: 170px;
        height: 55px;
        background-color: #00cf8c;
        border: 0;
        border-radius: 5px;
        font-size: 18px;
        margin-top: 50px;
      }
    }

    img {
      width: 100%;
      height: 350px;
      //position: absolute;
      //left: 0;
      //top: 0;
    }
  }

  .right {
    background-color: #E4E4E4;
    width: 50%;
    height: 350px;
    float: left;

    ul {
      overflow: hidden;

      li {
        height: 50px;
        text-align: left;
        padding-left: 50px;
        font-size: 18px;
        line-height: 50px;
        position: relative;
        .whitemb{
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 50px;
          background-color: #FFFFFF;
          border-left: 5px solid #00cf8c;
          color: #00cf8c;
          padding-left: 50px;
        }
      }
    }

  }
}

</style>